//
//  ZBarrageManager.swift
//  onemeetingmac
//
//  Created by 张衡 on 2020/6/10.
//  Copyright © 2020 onemeeting. All rights reserved.
//

import Foundation

class ZBarrageManager: NSObject {
    static let shared = ZBarrageManager()
    
}

class Barrage: NSView {
    static let shared = Barrage()
    
}


extension NSView {

    func bringSubviewToFront(_ view: NSView) {
        var theView = view
        self.sortSubviews({(viewA,viewB,rawPointer) in
            let view = rawPointer?.load(as: NSView.self)
            switch view {
            case viewA:
                return ComparisonResult.orderedDescending
            case viewB:
                return ComparisonResult.orderedAscending
            default:
                return ComparisonResult.orderedSame
            }
        }, context: &theView)
    }

}
